package com.weiyi.mashangzhu.listener;

import com.hyphenate.EMCallBack;
import com.weiyi.mashangzhu.Utils.ThreadUtil;

public abstract class CallBackListener implements EMCallBack {

    public abstract void onMainSuccess();

    public abstract void onMainError(int i, String s);

    @Override
    public void onSuccess() {
        ThreadUtil.runOnMainThread(new Runnable() {
            @Override
            public void run() {
                onMainSuccess();
            }
        });
    }

    @Override
    public void onError(final int code, final String message) {
        ThreadUtil.runOnMainThread(new Runnable() {
            @Override
            public void run() {
                onMainError(code, message);
            }
        });
    }

    @Override
    public void onProgress(int progress, String status) {
    }
}
